/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Juanan
 */
@Entity
@Table(name = "cod_coding")
@NamedQueries(
{
    @NamedQuery(name = "CodCoding.findAll", query = "SELECT c FROM CodCoding c")
})
public class CodCoding implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "COD_ID")
    private Integer codId;
    @Column(name = "COD_VALUE")
    private String codValue;
    @Column(name = "COD_VALUE2")
    private String codValue2;
    @JoinColumn(name = "PAR_ID", referencedColumnName = "PAR_ID")
    @ManyToOne(optional = false)
    private ParParameter parId;

    public CodCoding()
    {
    }

    public CodCoding(Integer codId)
    {
        this.codId = codId;
    }

    public Integer getCodId()
    {
        return codId;
    }

    public void setCodId(Integer codId)
    {
        this.codId = codId;
    }

    public String getCodValue()
    {
        return codValue;
    }

    public void setCodValue(String codValue)
    {
        this.codValue = codValue;
    }

    public String getCodValue2()
    {
        return codValue2;
    }

    public void setCodValue2(String codValue2)
    {
        this.codValue2 = codValue2;
    }

    public ParParameter getParId()
    {
        return parId;
    }

    public void setParId(ParParameter parId)
    {
        this.parId = parId;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (codId != null ? codId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CodCoding))
        {
            return false;
        }
        CodCoding other = (CodCoding) object;
        if ((this.codId == null && other.codId != null) || (this.codId != null && !this.codId.equals(other.codId)))
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "entities.CodCoding[ codId=" + codId + " ]";
    }
    
}
